<style lang="less">

</style>

<template>
  <div>
    <Select style="width:200px" @on-change="xpx(this)">
      <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
    </Select>
    <Upload
      multiple
      action="//txy.juyouhx.com/Api/Api/ObjectToOss/"
      :on-success="handleSuccess"
    >
      <Button icon="ios-cloud-upload-outline">Upload files</Button>
    </Upload>
    <face-comparison :isPlay="shows" @img-result="imgResult"></face-comparison>
    <Button type="primary" @click="TakePhoto">点击进行拍照并上传操作</Button>
  </div>
</template>

<script>
import { menus, goods } from '@/api/goods'
import FaceComparison from '_c/face-comparison'
// import upload from '@/libs/upload'
export default {
  components: { FaceComparison },
  data () {
    return {
      shows: false,
      columns1: [
        {
          title: 'Name',
          key: 'name'
        },
        {
          title: 'Age',
          key: 'age'
        },
        {
          title: 'Address',
          key: 'address'
        }
      ],
      data1: [
        {
          name: 'John Brown',
          age: 18,
          address: 'New York No. 1 Lake Par1k',
          date: '2016-10-03'
        },
        {
          name: 'Jim Green',
          age: 24,
          address: 'London No. 1 Lake Park',
          date: '2016-10-01'
        },
        {
          name: 'Joe Black',
          age: 30,
          address: 'Sydney No. 1 Lake Park',
          date: '2016-10-02'
        },
        {
          name: 'Jon Snow',
          age: 26,
          address: 'Ottawa No. 2 Lake Park',
          date: '2016-10-04'
        }
      ],
      cityList: [
        {
          value: 'New York',
          label: 'New York'
        },
        {
          value: 'London',
          label: 'London'
        },
        {
          value: 'Sydney',
          label: 'Sydney'
        },
        {
          value: 'Ottawa',
          label: 'Ottawa'
        },
        {
          value: 'Paris',
          label: 'Paris'
        },
        {
          value: 'Canberra',
          label: 'Canberra'
        }
      ],
      model1: '',
      serverResult: Object
    }
  },
  methods: {
    xpx (e, that) {
      console.log(e)
      console.log(that)
    },
    handleSuccess (res, file) {
      console.log(res)
      file.url = 'https://o5wwk8baw.qnssl.com/7eb99afb9d5f317c912f08b5212fd69a/avatar'
      file.name = '7eb99afb9d5f317c912f08b5212fd69a'
    },
    TakePhoto () {
      this.shows = true
    },
    imgResult (data) {
      this.serverResult = data
    },
    async awaitGoods () {
      let wx = await goods()
      console.log(wx, '等待返回来的数据')
      let next = await menus()
      console.log(next, '下一个等待返回来的数据')
    }
  },
  mounted () {
    this.awaitGoods()
  }
}
</script>

<style>

</style>
